using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class SoloChild : MonoBehaviour
{

    public void SetChildActive(Transform child)
    {
        foreach(Transform one in this.transform)
        {
            one.gameObject.SetActive(one == child);
        }
    }

    public GameObject SetChildActiveByName(string childName)
    {
        GameObject ret = null;
        foreach (Transform one in this.transform)
        {
            var isShow = one.gameObject.name == childName;
            one.gameObject.SetActive(isShow);
            if(isShow)
            {
                ret = one.gameObject;
            }
        }
        return ret;
    }
}
